﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<%
dim rs,sql,rs2,sql2,sid
title=request.form("title")
ProductNo=request.form("ProductNo")
etitle=request.form("etitle")
body=request.form("body")
ebody=request.form("ebody")
ssfl=request.form("ssfl")
img=request.form("img")
description2=request.form("description2")
edescription2=request.form("edescription2")
keyword=request.form("keyword")
ekeyword=request.form("ekeyword")
px_id=request.form("px_id")
homeshow=request.form("homeshow")
if homeshow ="" then
homeshow = 0
end if

if title=""  then 
response.Write("<script language=javascript>alert('产品中文名称不能为空!');history.go(-1)</script>") 
response.end 
end if
if etitle=""  then 
response.Write("<script language=javascript>alert('产品英文名称不能为空!');history.go(-1)</script>") 
response.end 
end if
if body="" then 
response.Write("<script language=javascript>alert('产品中文内容不能为空!');history.go(-1)</script>") 
response.end 
end if
if ebody="" then 
response.Write("<script language=javascript>alert('产品英文内容不能为空!');history.go(-1)</script>") 
response.end 
end if
if px_id="" then 
response.Write("<script language=javascript>alert('排序号不能为空!');history.go(-1)</script>") 
response.end 
end if
IF not isNumeric(request("px_id")) then
response.write("<script>alert(""排序ID必须为数字！""); history.go(-1);</script>")
response.end
end if

set rs2=server.createobject("adodb.recordset")
sql2="select * from shop_fl where id = "&ssfl&""
rs2.open sql2,conn,1,1
sid = rs2("sid")
rs2.close
set rs2=nothing

set rs=server.createobject("adodb.recordset")
sql="select * from shop"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("ProductNo")=ProductNo
rs("etitle")=etitle
rs("body")=body
rs("ebody")=ebody
rs("ssfl")=ssfl
rs("img")=img
rs("sid")=sid
rs("description2")=description2
rs("edescription2")=edescription2
rs("keyword")=keyword
rs("ekeyword")=ekeyword
rs("px_id")=px_id
rs("homeshow")=homeshow
rs.update

rs.close
set rs=nothing
conn.close
set conn = nothing
%>

<%
Response.Write "<script>alert('产品增加成功！点击继续添加！');window.location.href='add_shop.asp';</script>" 
%>

